home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer (Italian) 30 / PC Gamer IT CD 30 1-2.iso / MOTS / GAMEDATA / RESOURCE / JKMRES.GOO / cog_00_secretareas.cog < prev    next >
Text File  |  1998-02-25  |  3KB  |  88 lines

  1. # Jedi Knight Cog Script
  2. #
  3. # 00_SECRETAREAS.COG
  4. #
  5. # Maximum of 20 Secret areas, triggered upon entering a marked sector
  6. #
  7. # [IS & YB]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10.  
  11.  
  12. symbols
  13.  
  14. sector      secret0                          nolink local
  15. sector      secret1                          linkid=1
  16. sector      secret2                          linkid=2
  17. sector      secret3                          linkid=4
  18. sector      secret4                          linkid=8
  19. sector      secret5                          linkid=16
  20. sector      secret6                          linkid=32
  21. sector      secret7                          linkid=64
  22. sector      secret8                          linkid=128
  23. sector      secret9                          linkid=256
  24. sector      secret10                         linkid=512
  25. sector      secret11                         linkid=1024
  26. sector      secret12                         linkid=2048
  27. sector      secret13                         linkid=4096
  28. sector      secret14                         linkid=8192
  29. sector      secret15                         linkid=16384
  30. sector      secret16                         linkid=32768
  31. sector      secret17                         linkid=65536
  32. sector      secret18                         linkid=131072
  33. sector      secret19                         linkid=262144
  34. sector      secret20                         linkid=524288
  35.  
  36. int         player                           local
  37. int         maxSecrets=0                     local
  38. int         flags=0                          local
  39. int         i=0                              local
  40.  
  41. sound            wav0=Activate01.wav                    local
  42.  
  43. message     startup
  44. message     entered
  45.  
  46. end
  47.  
  48. # ========================================================================================
  49.  
  50. code
  51. startup:
  52.    player = GetLocalPlayerThing();
  53.  
  54.    // Total secret areas
  55.    for(i=1; i<=20; i=i+1)
  56.    {
  57.       if(secret0[i] >= 0)
  58.       {
  59.          maxSecrets = maxSecrets + 1;
  60.       }
  61.    }
  62.  
  63.    SetInv(player, 70, 0);              // set Secrets Found
  64.    SetInv(player, 71, maxSecrets);     // set Max Secrets on Level
  65.  
  66.    Return;
  67.  
  68. # ........................................................................................
  69.  
  70. entered:
  71.    // Secret already visited
  72.    if (flags & GetSenderID()) Return;
  73.  
  74.    flags = flags | GetSenderId();
  75.  
  76.     // Add one to secret counter
  77.    ChangeInv(player, 70, 1.0);
  78.  
  79.    // Print("Entered Secret Area.");
  80.    jkPrintUNIString(player, 360);
  81.  
  82.     PlaySoundLocal(wav0, 1.0, 0.0, 0x0);
  83.  
  84.    Return;
  85.  
  86. end
  87.  
  88.